<?php
  require_once('tpl/header.php');
?>
<?php 
    require_once('../system/loginCheck.php');
    require_once('../system/dbConn.php');
    connect();?>
    <h1>欢迎管理员<?php echo $_SESSION["adminname"]; ?>使用本系统</h1>
    <?php
    $sql="select * from comments";
    $result=mysql_query($sql);?>
                        <table class="table table-hover" align="center" width="60%">
                        <tr>
                            <th>序号</th>
                            <th>评论内容</th>
                            <th>评论人</th>
                            <th>发表评论的时间</th>
                            <th>操作</th>
                        </tr>
                        <?php  
                        while ( $row=mysql_fetch_assoc($result)) {?>
                        <tr>
                            <td><?php echo $row["cid"]; ?></td>
                            <td><?php echo $row["content"]; ?></td>
                            <td><?php $uid=$row["uid"];
                            $sql0="select uname from users where uid=$uid";
                            $result0=mysql_query($sql0);
                            $row0=mysql_fetch_assoc($result0);
                            echo $row0["uname"]; ?></td>
                            <td><?php echo $row["cdate"]; ?></td>
                            <td><a href="delectComment.php?cid=<?php echo $row["cid"]; ?>">删除</a></td>
                        </tr>
                           <?php  
                              }
                     ?>

                    </table>

   


<?php
  require_once('tpl/footer.php');
?>